#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>


int leap_year(int y) {
	if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)
		return 1;
	else
		return 0;
}


int main() {
	int y1, y2,count;
	printf("year1,year2:");
	while (scanf("%d %d", &y1, &y2) != EOF) {
		count = 0;
		if (y1 <= 0 || y2 <= 0) {
			break;
		}
		if (y1 > y2) {
			int temp = y2;
			y2 = y1;
			y1 = temp;
		}
		for (int i = y1; i <= y2; ++i) {
			if (leap_year(i))
				count++;
		}
		printf("leap years=%d\n", count);
		printf("year1,year2:");
	}
	printf("Bye!\n");
	return 0;
}